<template>
  <div>
    <ul>
      <!-- <li v-for="(item,index) in arr" :key="index">{{item}}</li> -->
       <li v-for="obj in list" :key="obj.id">{{obj.name}}</li>
    </ul>
    <button @click="add">添加</button>
  </div>
</template>

<script>
export default {
  data() {
      return{
        //   arr:["老大","老二","老三"],
          list:[{
              id:3,
              name:"张"
          },
          {
              id:34,
              name:"王"
          },
          {
              id:37,
              name:"李"
          }]
      }
  },
  methods:{
      add(){
        //   this.arr.splice(1,0,"新来的")
        this.list.splice(1,0,{id:4,name:"赵"})
      }
  }
};
</script>

<style>
</style>